package org.feiye.studyday15;

public abstract class Pet {
	protected String name;
	private int health, love;
	private String type;// 品种

	public Pet() {
	}

	public Pet(String name, int health, int love, String type) {
		super();
		this.name = name;
		this.health = health;
		this.love = love;
		this.type = type;
	}

	public int getHealth() {
		return health;
	}

	public void setHealth(int health) {
		this.health = health;
	}

	public int getLove() {
		return love;
	}

	public void setLove(int love) {
		this.love = love;
	}

	public String getType() {
		return type;
	}

	public void setName(String name) {
		this.name = name;
	}

	protected void setType(String n) {
		this.type = n;
	}

	// public Pet(){}
	public void printInfo() {
		System.out.println("这个宠物品种是" + type + ",名字是" + name);
		System.out.println("健康程度" + health + ",可爱程度：" + love);
	}

	public void playWith() {
		System.out.println(name + "在陪主人玩耍");
	}

	public abstract void run();

	public void shout() {
		System.out.println("宠物" + name + "在叫。。。");
	}

	public String getName() {
		return this.name;
	}

	@Override
	public String toString() {
		return "我叫" + name + "，是一条" + type + "，我的健康程度是：" + health + "，可爱程度是：" + love;
	}
}
